import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("dept", { schema: "charge" })
export class Dept {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("varchar", { name: "name", length: 50 })
  name: string;

  @Column("int", {
    name: "parent_id",
    comment: "上级",
    unsigned: true,
    default: () => "'0'",
  })
  parentId: number;

  @Column("int", {
    name: "top_id",
    comment: "最顶级id",
    unsigned: true,
    default: () => "'0'",
  })
  topId: number;
}
